<%= div_for activity, :class => 'root media' do %>
  <div class="avatar pull-left">
    <div class="media-object">
      <%= link_to image_tag(activity.sender_subject.logo.url('small'),
        :alt => activity.sender_subject.name), activity.sender_subject %>
    </div>
  </div>
  <header class="media-heading">
    <%= activity.title(self) %>

    <% if activity.direct_object && !activity.direct_object.acts_as_actor? && can?(:destroy, activity.direct_object) %>
    <div class="x" style="float: right"> 
      <%= link_to ('X'), activity.direct_object , :confirm => t('confirm_delete', 
                    :scope => activity.direct_object.class.to_s.underscore), :method => :delete,  
                    :remote => true %> 
    </div>
    <% end %>
  </header>

  <div class="media-body">
    <section class="objects">
      <%= render partial: 'activity_objects/timeline', 
                 collection: activity.activity_objects,
                 as: :object %>
    </section>

    <%= render :partial => 'activities/actions',
               :locals => { :activity => activity } %>

    <%= render :partial => 'activities/likes',
               :locals => { :activity => activity } %>

    <%= render :partial => 'activities/comments',
               :locals => { :activity => activity } %>

    <%= render :partial => 'comments/new',
               :locals => { :activity => activity } %>
  </div>
<% end %>
